package com.jarvan.repository;

import com.jarvan.model.Ticket;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

public interface TicketRepository extends JpaRepository<Ticket, String> {
    Page<Ticket> findAllByTrainId(String trainId, Pageable pageable);
    List<Ticket> findAllByBuyerId(Integer buyerId);
    Page<Ticket> findAllByBuyerId(Integer buyerId, Pageable pageable);
    List<Ticket> findAllByTrainIdAndDepartureDate(String trainId, String date);
    List<Ticket> findAllByBuyerIdAndTicketStatus(Integer buyerId, Integer ticketStatus);
    Page<Ticket> findAllByTicketStatus(Pageable pageable, Integer ticketStatus);
    Page<Ticket> findAllByPayStatus(Integer payStatus, Pageable pageable);
}
